import { NgModule }      from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { RouterModule ,Routes} from '@angular/router';
import { HttpModule } from '@angular/http';
import {FormsModule} from "@angular/forms"

import { AppComponent }  from './app.component';
import { Home } from '../app/component/home/home.component';
import { Photo } from '../app/component/photo/photo-list.component';
import { Side } from '../app/component/side/side-list.component';
import { NavBar } from '../app/component/bar/nav-bar.component';
import { Register } from '../app/pages/register/register';
import { Login } from '../app/pages/login/login';
import { RegisterServices } from '../app/services/http.register.services';
import { Album } from '../app/component/album/my-album.component';

// 设置路由
const routes: Routes = [
    { path: '', redirectTo: '/home', pathMatch: 'full' },
    { path: 'register',  component: Register },
    { path: 'home',  component: Home },
    { path: 'login',  component: Login },
    { path: 'album',  component: Album }

];

@NgModule({
  imports:      [
      BrowserModule,
      HttpModule,
      FormsModule,
      RouterModule.forRoot(routes)
  ],
  declarations: [
      AppComponent
      ,Home
      ,Photo
      ,Side
      ,NavBar
      ,Register
      ,Login
      ,Album
      ],
    providers:[RegisterServices],
  bootstrap:    [ AppComponent]
})
export class AppModule { }
